package com.myteam.fugaocrm.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;

import com.myteam.fugaocrm.service.RegisterServiceImpl;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 注册
 * @author BZX
 *
 */
@Controller
public class RegisterController {
	@Resource protected RegisterServiceImpl registerServiceImpl;
	
	@RequestMapping("register/register")
	@ResponseBody
	public String register(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String username = request.getParameter("username");  
		String password = request.getParameter("password");  
		String password2 = request.getParameter("password2");  
		String realname = request.getParameter("realname");  
		String mobile = request.getParameter("mobile");  
		
		return registerServiceImpl.register(username, password, password2, realname, mobile);
	}
}
